<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>添加/修改今日值班</title>
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/animate.min.css" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/style.min.css?v=4.0.0" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/plugins/toastr/toastr.min.css" rel="stylesheet">
	<link href="<%=request.getContextPath()%>/views/sysdefault/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
</head>

<body >


	<div class="ibox-content">

		<form id="subForm" method="post" class="form-horizontal"
			onsubmit="return addOndutyJson()">
			<input type="hidden" name="ondutyId" value="${onduty.ondutyId}" />
			<div class="form-group">
				<label class="col-sm-2 control-label">带班人名称：</label>
				<div class="col-sm-10">
					<input type="text" name="leader" placeholder="请输入带班人名称"
						class="form-control" required="" value="${onduty.leader}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">带班人电话：</label>
				<div class="col-sm-10">
					<input type="text" name="leaderPhone" placeholder="带班人电话"
						class="form-control" required=""  value="${onduty.leaderPhone}" >
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">值班人名称：</label>
				<div class="col-sm-10">
					<input type="text" name="name" placeholder="请输入值班人名称"
						class="form-control" required=""  value="${onduty.name}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">值班室电话：</label>
				<div class="col-sm-10">
					<input type="text" name="dutyphone" placeholder="请输入值班室电话"
						class="form-control" required=""  value="${onduty.dutyphone}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">值班人电话：</label>
				<div class="col-sm-10">
					<input type="text" name="telephone" placeholder="请输入值班人电话"
						class="form-control" required=""  value="${onduty.telephone}">
				</div>
			</div>
			<div class="form-group"  id="data_5">		
			    <label class="col-sm-2 control-label">选择值班时间:</label>
			    <div class="col-sm-10">
				    <div class="input-daterange input-group" id="datepicker">
	                    <input type="text" class="form-control" name="time" />         
	                </div>
			    </div>
			</div>
			
			<div class="hr-line-dashed"></div>
			<div class="form-group">
				<div class="col-sm-3 col-sm-offset-9">
					<button class="btn btn-primary" type="submit">保存内容</button>
					<button class="btn btn-white" onclick="clearForm();">清空</button>
				</div>
			</div>

		</form>

	</div>

	</div>

	<script src="<%=request.getContextPath()%>/views/sysdefault/js/jquery.min.js?v=2.1.4"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/bootstrap.min.js?v=3.3.5"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/content.min.js?v=1.0.0"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/toastr/toastr.min.js"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/layer/layer.js"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/bootstrap-table/bootstrap-table.js"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/datapicker/bootstrap-datepicker.js"></script>
    <script type="text/javascript">
    
    var basePath = '<%=request.getContextPath()%>';
    
    toastr.options = {
  		  "closeButton": true,
  		  "debug": false,
  		  "progressBar": true,
  		  "positionClass": "toast-top-left",
  		  "showDuration": "400",
  		  "hideDuration": "1000",
  		  "timeOut": "3000",
  		  "extendedTimeOut": "1000",
  		  "showEasing": "swing",
  		  "hideEasing": "linear",
  		  "showMethod": "fadeIn",
  		  "hideMethod": "fadeOut"
  		}
    //初始化日期控件
    $("#data_5 .input-daterange").datepicker({
        keyboardNavigation: !1,
        forceParse: !1,
        autoclose: !0
    });
    var addOndutyJson = function(){
    	
    	var index;
    	
    	$.ajax({
			type : "POST",
			url : basePath + "/bgPortGlutOnduty/addOnduty.ido",
			data : $("#subForm").serialize(),
			dataType : "json",
			success : function(msg) { 
				if (msg.errCode == '1') {
					parent.layerCallBack('1');
				}else{
					toastr.error(msg.errMsg, "提示");
				}
			},
			error : function(XMLHttpRequest, textStatus, errorThrown) {
				toastr.error("系统出错！", "提示");
			},
			beforeSend : function(XMLHttpRequest){
				index = layer.load(0, {
					  shade: [0.3,'#ccc'] //0.1透明度的白色背景
					});
			},
			complete : function(XMLHttpRequest, textStatus){
				layer.close(index);
			}
		});
	
		return false;
    }
    
    </script>
    
</body>

</html>